// 获取系统信息
const SYSTEM_INFO = uni.getSystemInfoSync();

// 手机状态栏的高度
export const getStatusBarHeight = () => SYSTEM_INFO.statusBarHeight || 15;

// 获取右上角胶囊按钮 与 状态栏位置差 算 导航栏标题高度
export const getTitleBarHeight = () => {
	//获取胶囊按钮数据的函数体
	if (uni.getMenuButtonBoundingClientRect) {
		let {
			top,
			height
		} = uni.getMenuButtonBoundingClientRect();
		return (top - getStatusBarHeight()) * 2 + height;
	} else {
		return 40;
	}
}

// 导航栏总高度
export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight();